/**
 * 请求注册接口
 */
export const reqUserRegister = data => http.post('/user/register', data)

/**
 * 请求登录接口
 */
export const reqUserLogin = data => http.post('/user/login', data)

/**
 * 请求获取个人信息接口
 */
export const reqUserInfo = () => http.get('/user/info')

/**
 * 请求更新个人信息接口
 */
export const reqUpdateUserInfo = data => http.put('/user/info', data)

/**
 * 请求所有类别
 */
export const reqCategory = () => http.get('/category')

/**
 * 请求所有类别
 */
export const reqCarId = () => http.get('/category/carId')

/**
 * 根据分类id获取该分类下所有类型车
 */
export const reqTypeList = categoryId => http.get(`/type/${categoryId}`)

/**
 *  根据类别id获取该类型车的信息
 */
export const reqTypeInfo = typeId => http.get(`/type/type-info/${typeId}`)

/**
 * 搜索类型
 */
export const reqTypeByName = name => http.get(`/type/search?q=${name}`)

/**
 *  根据类别id获取该类型车的信息
 */
export const reqShopByAddress = params =>
  http.get(`/shop/shopByAddress`, {
    params,
  })

/**
 *  提交订单记录
 */
export const reqUserOrder = data => http.post(`/order`, data)

/**
 *  获取该用户的订单记录
 */
export const reqUserOrderList = data => http.get(`/order`)

/**
 * 获取资讯
 */
export const reqNews = params => http.get('/news', { params })
